package com.kaifamiao.wendao.service;

import com.kaifamiao.wendao.dao.ThumbsDao;
import com.kaifamiao.wendao.entity.Thumbs;
import com.kaifamiao.wendao.utils.SnowflakeIdGenerator;

import java.util.List;

public class ThumbsService {
    private static ThumbsDao thumbsDao=new ThumbsDao();
    private static SnowflakeIdGenerator snowflakeIdGenerator=SnowflakeIdGenerator.getInstance();

    public boolean save(Thumbs t){
        t.setId(snowflakeIdGenerator.generate());
        return thumbsDao.save(t);
    }
    public Thumbs findId(Long id){
        return thumbsDao.find(id);
    }

    public Thumbs findCidEid(Long eid,Long cid){
        return thumbsDao.findCidEid(eid,cid);
    }

    public List<Thumbs> findAll(){
        return thumbsDao.findAll();
    }
    public boolean update(Thumbs t){
        return thumbsDao.update(t);
    }
}
